from scipy.io import loadmat


def read_data_txt(file_name):
    f = open(file_name, "r")
    raw_data = f.read().split()
    data = []
    count = 0
    for i in raw_data:
        if count % 1 == 0:
            data.append(float(i))
        count += 1

    return data


def read_data_mat(file_name,list_name):
    database = loadmat(file_name)
    data_list =database[list_name]
    bcg_data =[]
    for i in data_list:
        bcg_data.append(i[0])
    return bcg_data